package com.xzq.bustack;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

import java.net.Socket;

/**
 * @Author xzq
 * @Description //TODO
 * @Date 2021/11/19 14:33
 * @Version 1.0.0
 **/
public class MyChannelInitilizer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel ch) throws Exception {
        //自定义解码器
        ch.pipeline().addLast(new MyDecoder());
        //自定义编码器
        ch.pipeline().addLast(new MyEncoder());

        ch.pipeline().addLast(new MyServerHandler());

    }
}
